﻿/*
 * resultset.hpp
 *
 *  Created on: 2016年12月6日
 *      Author: work
 */

#ifndef _DM_OS_DB_RESULTSET_HPP_
#define _DM_OS_DB_RESULTSET_HPP_

#include <string>

namespace iotplat {

    class CResultSet {
        CResultSet(const CResultSet &);

        CResultSet &operator=(const CResultSet &);

    public:
        CResultSet();

        virtual ~CResultSet();

        virtual int size() const = 0;

        virtual bool next() = 0;

        virtual void reset() = 0;

        virtual bool asBool(int col) const = 0;

        virtual bool asBool(const char *col) const = 0;

        virtual int asInt(int col) const = 0;

        virtual int asInt(const char *col) const = 0;

        virtual uint asUint(int col) const = 0;

        virtual uint asUint(const char *col) const = 0;

        virtual double asDouble(int col) const = 0;

        virtual double asDouble(const char *col) const = 0;

        virtual std::string asString(int col) const = 0;

        virtual std::string asString(const char *col) const = 0;

        virtual bool isNull(int col) const = 0;

        virtual bool isNull(const char *col) const = 0;

        virtual int64_t asInt64(int col) const = 0;

        virtual int64_t asInt64(const char *col) const = 0;

        virtual int columnSize() const = 0;

        /**
         * 将列值转换成字符串
         **/
        virtual std::string valueString(int col) const = 0;

        /**
         * 将列值转换成字符串
         **/
        virtual std::string valueString(const char *col) const = 0;

        virtual void free() = 0;
    };
}




#endif /* INCLUDE_DM_OS_DB_RESULTSET_HPP_ */
